
<?php $lista = $this->listaDePedidos; ?>

<?php if ($lista == NULL):?>

<p>Nao existem categorias cadastras!</p>

<?php else :?>

	<table border="0" width="100%" cellpadding="0" cellspacing="0" id="content-table">
	<tr>
		<th rowspan="3" class="sized"><img src="/images/shared/side_shadowleft.jpg" width="20" height="300" alt="" /></th>
		<th class="topleft"></th>
		<td id="tbl-border-top">&nbsp;</td>
		<th class="topright"></th>
		<th rowspan="3" class="sized"><img src="/images/shared/side_shadowright.jpg" width="20" height="300" alt="" /></th>
	</tr>
	<tr>
		<td id="tbl-border-left"></td>
		<td>
		<!--  start content-table-inner ...................................................................... START -->
		<div id="content-table-inner">
		
			<!--  start table-content  -->
			<div id="table-content">
								 
				<!--  start product-table ..................................................................................... -->
				<form id="mainform" action="">
				<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
				<tr>
					<th class="table-header-repeat line-left"><a href="">Endereco de entrega</a></th>
					<th class="table-header-repeat line-left"><a href="">Hora do pedido</a></th>
					<th class="table-header-repeat line-left"><a href="">Data do pedido</a></th>
					<th class="table-header-options line-left"><a href="">Valor</a></th>
					<th class="table-header-options line-left"><a href="">Detalhes</a></th>
					
				</tr>
				
				<!-- Inicia o conteudo da tabela categoria -->
				<?php foreach ($lista as $pedido) :?>
				
				<?php 
					$data = explode(" ", $pedido["data_pedido"]);
					
					$hora = $data[1];

					$data = $data[0];
					
					$data = explode("-", $data);
					
					
					
				?>
				
				<tr>
					<td><?php echo $pedido["endereco_entrega"]; ?></td>
					<td><?php echo $hora; ?></td>
					<td><?php echo "{$data[2]}/{$data[1]}/{$data[0]}"; ?></td>
					<td><?php echo "R$ ".number_format($pedido["valor_total"], 2, ',', '.') ; ?></td>
					<td><a href="<?php echo  $this->url(array("controller"=>"pedido", "action"=> "ver-pedido", "id"=> $pedido["id_pedido"] ))?>">Detalhes</a></td>
					
				</tr>
				
				<?php endforeach;?>
				
				<!-- Final do conteudo da tabela categoria -->
				
				</table>
				<!--  end product-table................................... --> 
				</form>
			</div>
			
						<!--  end content-table  -->

	<?php endif ;?>